// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   MemoServiceImp.java

package com.iphaeton.lms.business.memo;

import com.iphaeton.exception.BusinessException;
import com.iphaeton.exception.PersistenceException;
import com.iphaeton.lms.business.PersistentServiceSupport;
import com.iphaeton.lms.pojo.memo.Memo;
import com.iphaeton.persistence.IPersistenceService;
import java.util.List;
import org.apache.log4j.Logger;

// Referenced classes of package com.iphaeton.lms.business.memo:
//            IMemoService

public class MemoServiceImp extends PersistentServiceSupport
    implements IMemoService
{

    public MemoServiceImp()
    {
    }

    public Memo save(Memo memo)
        throws BusinessException
    {
        try
        {
            memo = (Memo)hbpservice.store(memo);
        }
        catch(PersistenceException e)
        {
            e.printStackTrace();
            throw new BusinessException("\u5B58\u50A8\u5907\u5FD8\u8BB0\u5F55\u5230\u6570\u636E\u5E93\u65F6\u51FA\u9519!");
        }
        return memo;
    }

    public void remove(String id)
        throws BusinessException
    {
        try
        {
            hbpservice.remove(id, com.iphaeton.lms.pojo.memo.Memo.class);
        }
        catch(PersistenceException e)
        {
            e.printStackTrace();
            throw new BusinessException("\u4ECE\u6570\u636E\u5E93\u4E2D\u5220\u9664\u5907\u5FD8\u8BB0\u5F55\u65F6\u51FA\u9519!");
        }
    }

    public Memo findMemoById(String id)
        throws BusinessException
    {
        Memo m;
        try
        {
            m = (Memo)hbpservice.get(id, com.iphaeton.lms.pojo.memo.Memo.class);
        }
        catch(PersistenceException e)
        {
            e.printStackTrace();
            throw new BusinessException("\u901A\u8FC7Id\u67E5\u627E\u5907\u5FD8\u65F6\u51FA\u9519!");
        }
        return m;
    }

    public List findMemo(String user_id, String date)
        throws BusinessException
    {
        List list = null;
        String hql = "from Memo m where m.userId='" + user_id + "' and m.date='" + date + "'";
        try
        {
            list = hbpservice.query(hql);
        }
        catch(PersistenceException e)
        {
            e.printStackTrace();
            throw new BusinessException("\u67E5\u8BE2\u7528\u6237\u67D0\u5929\u5907\u5FD8\u8BB0\u5F55\u65F6\u51FA\u9519!");
        }
        return list;
    }

    private static Logger logger;
    static Class class$0; /* synthetic field */
    static Class class$1; /* synthetic field */

    static 
    {
        logger = Logger.getLogger(com.iphaeton.lms.business.memo.MemoServiceImp.class.getName());
    }
}
